#include <iostream>

#include "CLog.h"

using namespace std;

int main(int argc, char *argv[])
{
	if(argc<2) {
		cerr << "Usage : " << argv[0] << " <log file>" << endl;
		exit(-1);
	}

	char *logfile = argv[1];
	CLog *log = new CLog(logfile);

	// use primitive function
	log->print("this is first log", __LINE__, __FILE__);
	log->print("this is third log", __LINE__, __FILE__);

	// use cout-like stream object
	string msg = "this is cout-like << operator test";
	int x = 31321;
	char *p = "char pointer is okay";
	*log << msg << "\t" << x << "\t" << p << endl;
}
